// 运行时配置
import './global.less';
// 全局初始化数据配置，用于 Layout 用户信息和权限初始化
// 更多信息见文档：https://umijs.org/docs/api/runtime-config#getinitialstate
export async function getInitialState(): Promise<{ name: string }> {
  return { name: '@umijs/max' };
}

export const layout = () => {
  return {
    logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg',
    menu: {
      locale: false,
      request() {
        return [
          {
            name: 'MiniBpmnEditor',
            path: '/MiniBpmnEditor',
          },
          {
            name: 'FlowView',
            path: '/FlowView',
          },
          {
            path: '/',
            redirect: '/home',
          },
          {
            name: '首页',
            path: '/home',
            component: './Home',
          },
          {
            name: 'Test',
            path: '/test',
            component: './Test',
          },
          {
            name: 'Test2',
            path: '/test2',
            component: './Test2',
          },
          {
            name: 'Test3',
            path: '/test3',
            component: './Test3',
          },
          {
            name: 'Test4',
            path: '/test4',
            component: './Test4',
          },
          {
            name: 'Test5',
            path: '/test5',
            component: './Test5',
          },
          {
            name: '权限演示',
            path: '/access',
            component: './Access',
          },
          {
            name: ' CRUD 示例',
            path: '/table',
            component: './Table',
          },
          {
            name: 'BpmnEditor',
            path: '/BpmnEditor',
            component: './BpmnEditor',
          },
        ];

      }
    },
  };
};

export const request = {
  // responseInterceptors:[
  //   async (response: any, options: any) => {
  //     const { data } = response;
  //     return data;
  //   },
  // ]
};
